cmake_minimum_required(VERSION 3.20)
set(CMAKE_CXX_STANDARD 14)
project(FlashAttentionScore)

add_compile_definitions(_GLIBCXX_USE_CXX11_ABI=0)
include_directories(/usr/local/python3.7.5/lib/python3.7/site-packages/tensorflow/include)
link_directories(/usr/local/python3.7.5/lib/python3.7/site-packages/tensorflow/)

file(GLOB_RECURSE TF_OPS ./*.cpp)
add_library(flashattention SHARED ${TF_OPS})

target_link_libraries(flashattention /usr/local/python3.7.5/lib/python3.7/site-packages/tensorflow/libtensorflow_framework.so.2)
target_include_directories(flashattention PUBLIC /usr/local/python3.7.5/lib/python3.7/site-packages/tensorflow/include)

install(TARGETS flashattention LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX})